var dom = document.getElementById("main");
var myChart = echarts.init(dom);
var option;

var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;

option = {
  backgroundColor: '#000',
  globe: {
    baseTexture: '/images/earth.jpg',
    heightTexture: '/images/bathymetry_bw_composite_4k.jpg',
    displacementScale: 0.1,
    shading: 'lambert',
    environment: '/images/starfield.jpg',
    light: {
      ambient: {
        intensity: 0.1
      },
      main: {
        intensity: 1.5
      }
    },
    layers: [
      {
        type: 'blend',
        blendTo: 'emission',
        texture: '/images/night.jpg'
      },
      {
        type: 'overlay',
        texture: '/images/clouds.png',
        shading: 'lambert',
        distance: 5
      }
    ]
  },
  series: []
};

option && myChart.setOption(option);

if (option && typeof option === 'object') {
  myChart.setOption(option);
}